package com.bawei.bydayzg_two

import android.content.Intent
import android.os.Bundle
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.bawei.user.LoginActivity
import com.bawei.user.UserInfoActivity
import com.blankj.utilcode.util.ToastUtils

@Route(path = "/app/MainActivity")
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
       //
        requestPermissions(arrayOf(
            "android.permission.VIBRATE",
            "android.permission.RECORD_AUDIO" ,
            "android.permission.CAMERA",
            "android.permission.ACCESS_NETWORK_STATE",
            "android.permission.WRITE_EXTERNAL_STORAGE" ,
            "android.permission.ACCESS_FINE_LOCATION",
            "android.permission.GET_TASKS" ,
            "android.permission.ACCESS_WIFI_STATE" ,
            "android.permission.CHANGE_WIFI_STATE" ,
            "android.permission.WAKE_LOCK",
            "android.permission.MODIFY_AUDIO_SETTINGS",
            "android.permission.READ_PHONE_STATE",
            "android.permission.RECEIVE_BOOT_COMPLETED",
            "android.permission.FOREGROUND_SERVICE",
            "android.permission.ACCESS_COARSE_LOCATION"
        ),100)


        //
        findViewById<TextView>(R.id.tv).setOnClickListener {
            ToastUtils.showLong("aaaaa")
//            startActivity(Intent(this@MainActivity,LoginActivity::class.java))
            ARouter.getInstance().build("/app/ShopActivity").navigation()
            //挡路了跳转主页，未登录跳转登录页面

        }

        //
//        findViewById<TextView>(R.id.tv).setOnClickListener {
//            startActivity(Intent(this@MainActivity, UserInfoActivity::class.java))
//        }
    }
}